<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user', function (Blueprint $table) {
            $table->engine = 'InnoDB';

            $table->increments('id');
            $table->string('name', 24);
            $table->string('oauthid', 42);
            $table->bigInteger('created_at');
            $table->bigInteger('updated_at');
            $table->bigInteger('deleted_at');
            $table->unique('oauthid');
        });

        Schema::create('nav', function (Blueprint $table) {
            $table->engine = 'InnoDB';

            $table->increments('id');
            $table->string('name', 12);
            $table->string('href', 255);
            $table->bigInteger('sort');
            $table->index('id');
        });

        Schema::create('interlocution', function (Blueprint $table) {
            $table->engine = 'InnoDB';

            $table->increments('id');
            $table->text('body');
            $table->bigInteger('uid');
            $table->bigInteger('created_at');
            $table->bigInteger('deleted_at');
            $table->bigInteger('for');
            $table->bigInteger('status');
            $table->index('uid');
            $table->index('for');
        });

        Schema::create('article', function (Blueprint $table) {
            $table->engine = 'InnoDB';

            $table->increments('id');
            $table->string('title', 60);
            $table->text('body');
            $table->bigInteger('created_at');
            $table->bigInteger('updated_at');
            $table->bigInteger('deleted_at');
            $table->bigInteger('click_num');
            $table->unique('id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('user');
    }
}
